
                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                    </svg>
                    <blockquote> 
 <p><strong>高级的题库更新之后，专业性更强了，不是真正从事这一行的，很难做出来。本人就是个小菜鸡，有一些题，我也不想不明白。题目的答案我尽可能的找到出处，如果读者发现错误或有补充建议，欢迎评论或私信笔者。笔者这篇就当抛砖引玉，各位读者可以当作考试的一个参考</strong></p> 
</blockquote> 
<h4><a name="t0"></a><a id="HarmonyOShttpsblogcsdnnetGusha_articledetails140072321spm1001201430015502_4"></a>基础认证题库请移步：<a href="https://blog.csdn.net/Gusha_/article/details/140072321?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者基础认证题库</a></h4> 
<hr> 
<h3><a name="t1"></a><a id="20_7"></a><code style="user-select: auto;">注：有读者反馈，题库的代码块比较多，打开文章时会卡死。所以笔者将题库拆分，以20道题为一组，题库目录如下，读者可以按需跳转。如果对您的阅读产生不便，笔者在这里向大家说声抱歉，请各位读者原谅。该题库已整理完毕，笔者不再更新。笔者连续考了三次，都过了，所以答案应该没什么太大问题。有需要题库文档的可以自取。祝各位读者好运(๑¯ω¯๑)。</code></h3> 
<h2><a name="t2"></a><a id="_9"></a>序号目录：</h2> 
<ul><li>单选题<br> <a href="https://blog.csdn.net/Gusha_/article/details/140295266?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号1</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140580616?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号2</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140580633?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号3</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140617294" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号4</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140749409?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号5</a></li><li>多选题<br> <a href="https://blog.csdn.net/Gusha_/article/details/140580653?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 多选题序号1</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140580668?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 多选题序号2</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140613052?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 多选题序号3</a></li><li>答案纯享版<br> <a href="https://blog.csdn.net/Gusha_/article/details/140676104?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 答案纯享版</a></li></ul> 
<hr> 
<h4><a name="t3"></a><a id="httpspanbaiducoms153tDk4dVv_MmLEyzOqW9hQpwdxkgr_23"></a>题库文档链接（自取）：https://pan.baidu.com/s/153tDk4dVv_MmLEyzOqW9hQ?pwd=xkgr</h4> 
<hr> 
<h2><a name="t4"></a><a id="_26"></a>注：题目是乱序，每次考试，选项的顺序都不同</h2> 
<h3><a name="t5"></a><a id="_09_091_28"></a>单选题题库 - 序号1</h3> 
<hr> 
<p>1、以下关于Taskpool和Worker的描述正确的是</p> 
<p>​ A、Worker自行管理命周期，开发者无需关心任务负载高低</p> 
<p>​ <code style="user-select: auto;">B、TaskPool支持任务延时执行</code></p> 
<p>​ C、开发者需要自行管理taskpool的数量及<a href="https://so.csdn.net/so/search?q=%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F&amp;spm=1001.2101.3001.7020" target="_blank" class="hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;生命周期\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;生命周期\&quot;}&quot;}" data-tit="生命周期" data-pretit="生命周期">生命周期</a></p> 
<p>​ D、TaskPool和Worker的任务执行时长上限都是无限制</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/taskpool-vs-worker-V5#%E5%AE%9E%E7%8E%B0%E7%89%B9%E7%82%B9%E5%AF%B9%E6%AF%94" rel="nofollow" target="_blank">TaskPool和Worker的对比 (TaskPool和Worker)-使用多线程并发能力进行开发-并发-ArkTS（方舟编程语言）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>2、以下哪个<a href="https://so.csdn.net/so/search?q=%E8%A3%85%E9%A5%B0%E5%99%A8&amp;spm=1001.2101.3001.7020" target="_blank" class="hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E8%A3%85%E9%A5%B0%E5%99%A8&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;装饰器\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E8%A3%85%E9%A5%B0%E5%99%A8&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;装饰器\&quot;}&quot;}" data-tit="装饰器" data-pretit="装饰器">装饰器</a>用来表示并发共享对象。</p> 
<p>​ A、@State</p> 
<p>​ <code style="user-select: auto;">B、@Sendable</code></p> 
<p>​ C、@Shared</p> 
<p>​ D、@Style</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-sendable-V5" rel="nofollow" target="_blank">Sendable开发指导-附录-并发-ArkTS（方舟编程语言）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p><strong>3、ArkTS支持以下哪些函数（不确定，Object类里都有这些方法）</strong></p> 
<p>​ <code style="user-select: auto;">A、Object.keys();</code></p> 
<p>​ <strong>B、Object.getOwnPropertySymbols();</strong></p> 
<p>​ <strong>C、Object.isExtensible();</strong></p> 
<p>​ <strong>D、Object.isPrototypeOf();</strong></p> 
<hr> 
<p>4、以下哪些赋值语句在ArkTS中是合法。</p> 
<pre data-index="0" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">class</span> <span class="token class-name"><span class="token constant">C</span></span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">}</span>

<span class="token keyword">let</span> value1<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span> 
<span class="token keyword">let</span> value2<span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">|</span> <span class="token keyword">null</span> <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
<span class="token keyword">let</span> value3<span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">|</span> <span class="token keyword">undefined</span> <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
<span class="token keyword">let</span> value4<span class="token operator">:</span> <span class="token constant">C</span> <span class="token operator">=</span> <span class="token keyword">null</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:0,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ A、value1</p> 
<p>​ <code style="user-select: auto;">B、value2</code></p> 
<p>​ C、value3</p> 
<p>​ D、value4</p> 
<hr> 
<p><strong>5、ArkTS支持以下哪个函数。（不确定，Object类里都有这些方法）</strong></p> 
<p>​ <code style="user-select: auto;">A、Object.values();</code></p> 
<p>​ <strong>B、Object.getOwnPropertyDescriptors();</strong></p> 
<p>​ <strong>C、Object.getOwnPropertyDescriptor();</strong></p> 
<p>​ <strong>D、Object.hasOwnProperty();</strong></p> 
<hr> 
<p>6、下面哪种转场效果在入场动画时，表现为从透明度为0、相对于<span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;组件\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;组件\&quot;}&quot;}" data-tit="组件" data-pretit="组件">组件</span>正常显示位置×方向平移100vp的状态，到默认的透明度为1、相对于组件不平移的状态，且透明度动画和平移动画的动画时长均为2000ms</p> 
<p>​ A、TransitionEffect.asymmetric(TransitionEffect.OPACITY.animation({duration:2000})，TransitionEffect.translate({x:100}).animation({duration:2000}))</p> 
<p>​ <code style="user-select: auto;">B、TransitionEffect.OPACITY.animation({duration:2000}).combine(TransitionEffect.translate({x:100}))</code></p> 
<p>​ C、TransitionEffect.translate({x:100}).combine(TransitionEffect.OPACITY.animation({duration:2000}))</p> 
<p>​ D、TransitionEffect.OPACITY.combine(TransitionEffect.translate({x:100}).animation({duration:2000}))</p> 
<p><strong>注：</strong><code style="user-select: auto;">放到代码块里，方便查看</code></p> 
<pre data-index="1" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;">TransitionEffect<span class="token punctuation">.</span><span class="token function">asymmetric</span><span class="token punctuation">(</span>TransitionEffect<span class="token punctuation">.</span><span class="token constant">OPACITY</span><span class="token punctuation">.</span><span class="token function">animation</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
TransitionEffect<span class="token punctuation">.</span><span class="token function">translate</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>x<span class="token operator">:</span><span class="token number">100</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">animation</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:1,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="2" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">// 答案	=========================================</span>
TransitionEffect<span class="token punctuation">.</span><span class="token constant">OPACITY</span>
    <span class="token punctuation">.</span><span class="token function">animation</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">.</span><span class="token function">combine</span><span class="token punctuation">(</span>TransitionEffect<span class="token punctuation">.</span><span class="token function">translate</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>x<span class="token operator">:</span><span class="token number">100</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:2,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="3" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;">TransitionEffect
    <span class="token punctuation">.</span><span class="token function">translate</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>x<span class="token operator">:</span><span class="token number">100</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">.</span><span class="token function">combine</span><span class="token punctuation">(</span>TransitionEffect<span class="token punctuation">.</span><span class="token constant">OPACITY</span><span class="token punctuation">.</span><span class="token function">animation</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:3,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="4" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;">TransitionEffect<span class="token punctuation">.</span><span class="token constant">OPACITY</span>
    <span class="token punctuation">.</span><span class="token function">combine</span><span class="token punctuation">(</span>TransitionEffect<span class="token punctuation">.</span><span class="token function">translate</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>x<span class="token operator">:</span><span class="token number">100</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">animation</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:4,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-enter-exit-transition-V5" rel="nofollow" target="_blank">出现/消失转场-转场动画-使用动画-UI开发 (ArkTS声明式开发范式)-ArkUI（方舟UI框架）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p><strong>7、现有一个宽高分别为200px的XComponent组件，其绑定了一个XComponentController(xcController)，依次进行如下操作:</strong></p> 
<p><strong>（1）xcController.setXComponentSurfaceRect( {surfaceWidth: 150, surfaceHeight: 500})</strong></p> 
<p><strong>（2）设置XComponent组件的padding为{ top: 5px, left: 10px, bottom: 15px, right: 20px }</strong></p> 
<p><strong>（3）将XComponent组件大小改为300px * 300px</strong></p> 
<p><strong>（4）给XComponent组件设置一个宽度为2px的边框</strong></p> 
<p><strong>（5）xcController.setXComponentSurfaceRect( { offsetX: -20, offsetY: 50, surfaceWidth: 200, surfaceHeight: -100 } )之后，调用xcController.getXComponentSurfaceRect()的返回值为</strong></p> 
<p>​ <strong>A、{ offsetX: 81, offsetY: -89, surfaceWidth: 150, surfaceHeight: 500 }</strong></p> 
<p>​ <strong>B、{ offsetX: 81, offsetY: -89, surfaceWidth: 200, surfaceHeight: 0 }</strong></p> 
<p>​ <strong>C、{ offsetX: -20, offsetY: 50, surfaceWidth: 200, surfaceHeight: 500 }</strong></p> 
<p>​ <code style="user-select: auto;">D、{ offsetX: 75, offsetY: -100, surfaceWidth: 150, surfaceHeight: 500 }</code></p> 
<p><strong>不确定，把所有选项列出</strong></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-xcomponent-V5" rel="nofollow" target="_blank">XComponent-基础组件-基于ArkTS的声明式开发范式-ArkTS组件-ArkUI（方舟UI框架）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>8、根据上面代码，以下解释正确的是</p> 
<p><strong>注：</strong><code style="user-select: auto;">被注释的代码是额外加上的，用于测试，并非题目原本的</code></p> 
<pre data-index="5" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">enum</span> Mode <span class="token punctuation">{<!-- --></span>
  fullScreen<span class="token punctuation">,</span>
  halfScreen
<span class="token punctuation">}</span>

<span class="token decorator"><span class="token at operator">@</span><span class="token function">Entry</span></span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct Index <span class="token punctuation">{<!-- --></span>

  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> title<span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">=</span> <span class="token string">""</span><span class="token punctuation">;</span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> mode<span class="token operator">:</span> Mode <span class="token operator">=</span> Mode<span class="token punctuation">.</span>fullScreen<span class="token punctuation">;</span>

  <span class="token function">isShowTitle</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">boolean</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>mode <span class="token operator">==</span> Mode<span class="token punctuation">.</span>fullScreen<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>title <span class="token operator">=</span> <span class="token string">"Title"</span><span class="token punctuation">;</span>

      <span class="token keyword">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token keyword">else</span> <span class="token punctuation">{<!-- --></span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>title <span class="token operator">=</span> <span class="token string">"Section"</span><span class="token punctuation">;</span>
      <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>

  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
      <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">isShowTitle</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Text</span><span class="token punctuation">(</span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${<!-- --></span><span class="token keyword">this</span><span class="token punctuation">.</span>title<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Text</span><span class="token punctuation">(</span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${<!-- --></span><span class="token keyword">this</span><span class="token punctuation">.</span>title<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span>
      <span class="token function">ChangeMode</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span> mode<span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span>mode<span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct ChangeMode <span class="token punctuation">{<!-- --></span>
  <span class="token comment">//@Link mode: Mode;</span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">Prop</span></span> mode<span class="token operator">:</span> Mode<span class="token punctuation">;</span>
  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Row</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>space<span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'full screen'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>mode <span class="token operator">=</span> Mode<span class="token punctuation">.</span>fullScreen
      <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'half screen'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>mode <span class="token operator">=</span> Mode<span class="token punctuation">.</span>halfScreen
      <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token comment">//Text(this.mode.toString())</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li><li style="color: rgb(153, 153, 153);">34</li><li style="color: rgb(153, 153, 153);">35</li><li style="color: rgb(153, 153, 153);">36</li><li style="color: rgb(153, 153, 153);">37</li><li style="color: rgb(153, 153, 153);">38</li><li style="color: rgb(153, 153, 153);">39</li><li style="color: rgb(153, 153, 153);">40</li><li style="color: rgb(153, 153, 153);">41</li><li style="color: rgb(153, 153, 153);">42</li><li style="color: rgb(153, 153, 153);">43</li><li style="color: rgb(153, 153, 153);">44</li><li style="color: rgb(153, 153, 153);">45</li><li style="color: rgb(153, 153, 153);">46</li><li style="color: rgb(153, 153, 153);">47</li><li style="color: rgb(153, 153, 153);">48</li><li style="color: rgb(153, 153, 153);">49</li><li style="color: rgb(153, 153, 153);">50</li><li style="color: rgb(153, 153, 153);">51</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:5,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ A、本例子可以运行起来，所以代码没有问题。</p> 
<p>​ B、在ChangeMode里改变mode的值，会触发其父组件Page的Title内容的切换。</p> 
<p>​ C、为了避免@Prop的拷贝，可以优化使用@Link，在该例子中行为和@Prop一样。</p> 
<p>​ <code style="user-select: auto;">D、在自定义组件Page的build方法里改变状态变量是非法操作，可能导致未定义的异常UI行为。</code></p> 
<hr> 
<p><strong>9、已知下列代码PageOne页面为navigation中的某一子页面，依次点击PageOne页面中toPageTwo按钮，PageTwo页面中toPageOne按钮，此时点击get按钮获取全部名为name的NavDestination页面的位置索引为（不确定，把所有选项列出）</strong></p> 
<pre data-index="6" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">// PageOne.ets</span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
<span class="token keyword">export</span> struct PageOneTmp <span class="token punctuation">{<!-- --></span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">Consume</span></span><span class="token punctuation">(</span><span class="token string">'pageInfos'</span><span class="token punctuation">)</span> pageInfos<span class="token operator">:</span> NavPathStack<span class="token punctuation">;</span>

  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">NavDestination</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'toPageTwo'</span><span class="token punctuation">,</span> <span class="token punctuation">{<!-- --></span> stateEffect<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> type<span class="token operator">:</span> ButtonType<span class="token punctuation">.</span>Capsule <span class="token punctuation">}</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'80%'</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token number">40</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">margin</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>pageInfos<span class="token punctuation">.</span><span class="token function">pushPathByName</span><span class="token punctuation">(</span><span class="token string">'pageTwo'</span><span class="token punctuation">,</span><span class="token string">""</span><span class="token punctuation">)</span>
          <span class="token punctuation">}</span><span class="token punctuation">)</span>
        <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'get'</span><span class="token punctuation">,</span> <span class="token punctuation">{<!-- --></span> stateEffect<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> type<span class="token operator">:</span> ButtonType<span class="token punctuation">.</span>Capsule <span class="token punctuation">}</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'80%'</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token number">40</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">margin</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
            <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'获取全部名称为name的NavDestination页面的位置索引'</span><span class="token punctuation">,</span> <span class="token constant">JSON</span><span class="token punctuation">.</span><span class="token function">stringify</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>pageInfos<span class="token punctuation">.</span><span class="token function">getIndexByName</span><span class="token punctuation">(</span><span class="token string">'PageOne'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
          <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">title</span><span class="token punctuation">(</span><span class="token string">'pageOne'</span><span class="token punctuation">)</span>
    <span class="token punctuation">.</span><span class="token function">onBackPressed</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
      <span class="token keyword">const</span> popDestinationInfo <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>pageInfos<span class="token punctuation">.</span><span class="token function">pop</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
      <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'pop返回值'</span> <span class="token operator">+</span> <span class="token constant">JSON</span><span class="token punctuation">.</span><span class="token function">stringify</span><span class="token punctuation">(</span>popDestinationInfo<span class="token punctuation">)</span><span class="token punctuation">)</span>
      <span class="token keyword">return</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:6,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="7" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">// PageTwo.ets</span>
<span class="token keyword">export</span> <span class="token keyword">class</span> <span class="token class-name">Pages</span><span class="token punctuation">{<!-- --></span>
  names<span class="token operator">:</span> <span class="token builtin">string</span> <span class="token operator">=</span> <span class="token string">""</span>
  values<span class="token operator">:</span> NavPathStack <span class="token operator">|</span> <span class="token keyword">null</span> <span class="token operator">=</span> <span class="token keyword">null</span>
<span class="token punctuation">}</span>

<span class="token decorator"><span class="token at operator">@</span><span class="token function">Builder</span></span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">pageTwoTmp</span><span class="token punctuation">(</span>info<span class="token operator">:</span> Pages<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
  <span class="token function">NavDestination</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'toPageOne'</span><span class="token punctuation">,</span> <span class="token punctuation">{<!-- --></span> stateEffect<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> type<span class="token operator">:</span> ButtonType<span class="token punctuation">.</span>Capsule <span class="token punctuation">}</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'80%'</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token number">40</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">margin</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token punctuation">(</span>info<span class="token punctuation">.</span>values <span class="token keyword">as</span> NavPathStack<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">pushPathByName</span><span class="token punctuation">(</span><span class="token string">'pageOne'</span><span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">title</span><span class="token punctuation">(</span><span class="token string">'pageTwo'</span><span class="token punctuation">)</span>
  <span class="token punctuation">.</span><span class="token function">onBackPressed</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
    <span class="token punctuation">(</span>info<span class="token punctuation">.</span>values <span class="token keyword">as</span> NavPathStack<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">pop</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token boolean">true</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:7,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <strong>A：[1,2]</strong></p> 
<p>​ <strong>B：[2,1]</strong></p> 
<p>​ <code style="user-select: auto;">C：[0,2]</code></p> 
<p>​ <strong>D：[0,1]</strong></p> 
<hr> 
<p>10、以下示例代码中可以进行动画的属性有哪些？</p> 
<pre data-index="8" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct MyComponent <span class="token punctuation">{<!-- --></span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> compWidth<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> <span class="token number">100</span><span class="token punctuation">;</span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> compHeight<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> <span class="token number">100</span><span class="token punctuation">;</span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> compRadius<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> <span class="token number">32</span><span class="token punctuation">;</span>
  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>

    <span class="token punctuation">}</span>
    <span class="token comment">//.backgroundColor(Color.Red)</span>
    <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>compWidth<span class="token punctuation">)</span>  <span class="token comment">//  1</span>
    <span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>compHeight<span class="token punctuation">)</span>  <span class="token comment">//  2</span>
    <span class="token punctuation">.</span><span class="token function">animation</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span> curve<span class="token operator">:</span> Curve<span class="token punctuation">.</span>Ease<span class="token punctuation">,</span> duration<span class="token operator">:</span> <span class="token number">200</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">.</span><span class="token function">borderRadius</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>compRadius<span class="token punctuation">)</span>  <span class="token comment">//  3</span>
    <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>compWidth <span class="token operator">+=</span> <span class="token number">10</span><span class="token punctuation">;</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>compHeight <span class="token operator">+=</span> <span class="token number">10</span><span class="token punctuation">;</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>compRadius <span class="token operator">+=</span> <span class="token number">4</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token comment">/*
@Entry
@Component
struct Index {
  build() {
    Column(){
      MyComponent()
    }
  }
}
*/</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:8,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ A、2、3</p> 
<p>​ B、1、3</p> 
<p>​ C、1、2、3</p> 
<p>​ <code style="user-select: auto;">D、1、2</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-attribute-animation-apis-V5" rel="nofollow" target="_blank">属性动画接口说明-属性动画-使用动画-UI开发 (ArkTS声明式开发范式)-ArkUI（方舟UI框架）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>11、依次点击A、B、C、D四个按钮，其中不会触发UI刷新的是：</p> 
<pre data-index="9" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">class</span> <span class="token class-name">Info</span><span class="token punctuation">{<!-- --></span>
  name<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>

  <span class="token function">constructor</span><span class="token punctuation">(</span>name<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>name <span class="token operator">=</span> name<span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token decorator"><span class="token at operator">@</span><span class="token function">Entry</span></span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct Index <span class="token punctuation">{<!-- --></span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> nameList<span class="token operator">:</span> Info<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"Tom"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"Bob"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"John"</span><span class="token punctuation">)</span><span class="token punctuation">]</span>

  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">ForEach</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>nameList<span class="token punctuation">,</span> <span class="token punctuation">(</span>item<span class="token operator">:</span> Info<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Text</span><span class="token punctuation">(</span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${<!-- --></span>item<span class="token punctuation">.</span>name<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">"A"</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>nameList<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"Lucy"</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">"B"</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>nameList<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"Eric"</span><span class="token punctuation">)</span>

        <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">"C"</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>nameList<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>name <span class="token operator">=</span> <span class="token string">"Jim"</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span>
      <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">"D"</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>nameList <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"Barry"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"Cindy"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">new</span> <span class="token class-name">Info</span><span class="token punctuation">(</span><span class="token string">"David"</span><span class="token punctuation">)</span><span class="token punctuation">]</span>

        <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li><li style="color: rgb(153, 153, 153);">34</li><li style="color: rgb(153, 153, 153);">35</li><li style="color: rgb(153, 153, 153);">36</li><li style="color: rgb(153, 153, 153);">37</li><li style="color: rgb(153, 153, 153);">38</li><li style="color: rgb(153, 153, 153);">39</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:9,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ A、A</p> 
<p>​ B、B</p> 
<p>​ <code style="user-select: auto;">C、C</code></p> 
<p>​ D、D</p> 
<hr> 
<p><strong>12、从桌面冷启动如下应用，点击Change按钮5次，整个过程中，代码中的2条log依次出现的次数，最初和最后画面上显示的【num = ?】的数字是（不确定，题目代码出错）</strong></p> 
<pre data-index="10" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">// ERROR 题目出错</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.900673;"><li style="color: rgb(153, 153, 153);">1</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:10,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <strong>A、0,6,1,6</strong></p> 
<p>​ <strong>B、1,5,1,6</strong></p> 
<p>​ <strong>C、2,4,1,6</strong></p> 
<p>​ <code style="user-select: auto;">D、2,4,1,2</code></p> 
<hr> 
<p>13、使用promptAction.showToast如何设置显示在其他应用之上？</p> 
<p>​ A、ToastShowMode.DEFAULT</p> 
<p>​ B、ToastShowMode.SYSTEM_TOP_MOST</p> 
<p>​ <code style="user-select: auto;">C、ToastShowMode.TOP_MOAST</code></p> 
<p>​ D、无需配置,默认显示在其他应用之上</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-promptaction-V5#toastshowmode11" rel="nofollow" target="_blank">@ohos.promptAction (弹窗)-UI界面-ArkTS API-ArkUI（方舟UI框架）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>14、在使用DevEco Studio的Profiler进行<span class="words-blog hl-git-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.10283&quot;,&quot;extra&quot;:&quot;{\&quot;words\&quot;:\&quot;HarmonyOS应用\&quot;}&quot;}" data-tit="HarmonyOS应用" data-pretit="harmonyos应用">HarmonyOS应用</span><span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;性能优化\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;性能优化\&quot;}&quot;}" data-tit="性能优化" data-pretit="性能优化">性能优化</span>的流程中，以下哪个步骤最恰当地描述了开发者利用Profiler工具进行性能问题识别、定位、优化及验证的完整过程</p> 
<p>​ A、仅通过创建深度分析任务，利用perf数据详细分析性能瓶颈，修改代码后，不需再进行验证直接发布应用</p> 
<p>​ B、首先使用"Realtime Monitor"实时监控，观察应用资源消耗，一旦发现CPU或内存异常，直接修改代码并重新编译</p> 
<p>​ <code style="user-select: auto;">C、利用"Realtime Monitor"初步识别性能瓶颈，创建深度分析任务定位根因，根据分析结果优化代码，再用"Realtime Monitor"验证优化效果</code></p> 
<p>​ D、在发现应用性能不佳时，直接查看代码逻辑，凭经验修改后，利用Profiler的"Realtime Monitor"确认资源消耗是否降低</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-profiler-process-0000001818032669-V5" rel="nofollow" target="_blank">性能优化过程简介-使用Profiler进行性能调优-性能分析-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>15、DevEco Studio提供HarmonyOS应用/服务的UI预览界面与源代码文件间的双向预览功能，支持ets文件与预览器界面的双向预览。关于双向预览，下列选项说法错误的是？</p> 
<p>​ A、选中预览器UI界面中的组件，则组件树上对应的组件将被选中，同时代码编辑器中的布局文件中对应的代码块高亮显示。</p> 
<p>​ <code style="user-select: auto;">B、双向预览不支持通过组件的属性面板实时修改属性或样式。</code></p> 
<p>​ C、选中布局文件中的代码块，则在UI界面会高亮显示，组件树上的组件节点也会呈现被选中的状态。</p> 
<p>​ D、选中组件树中的组件，则对应的代码块和U界面也会高亮显示。</p> 
<hr> 
<p><strong>16、项目中包含多个模块和数千行代码。随着开发的深入，项目中的ArkTS源代码文件逐渐积累了大量import语句，其中不乏未使用的import以及不规范的排序情况，关于DevEco Studio的编辑器的"Optimize Imports"，以下说法正确的是（不确定，CD都可以清理import语句。）</strong></p> 
<p>​ <strong>A、应该手动遍历每个ArkTS文件，逐一检查并删除未使用的import语句，然后按照字母顺序手动排序剩余的import。</strong></p> 
<p>​ <strong>B、在DevEco Studio中，没有直接的"Optimize Imports"功能，需要安装第三方插件来实现这个需求。</strong></p> 
<p>​ <strong>C、为了快速清理未使用的import，可以选中项目根目录，按下快捷键Ctrl+Alt+O（在macOS上为Control+Option+O)，让DevEco Studio自动识别并移除所有未使用的import，并自动按照预设规则排序和合并import。</strong></p> 
<p>​ <code style="user-select: auto;">D、可以在菜单栏中依次点击"Code"&gt;"Reformat Code"来达到优化import的目的，因为"Optimize Imports"功能已整合进"Reformat Code"中。</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-editer-overview-0000001053502418-V5#section1983775315599" rel="nofollow" target="_blank">代码阅读-代码编辑-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>17、在使用DevEco Studio的Profiler进行HarmonyOS应用或服务<span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;内存管理\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;内存管理\&quot;}&quot;}" data-tit="内存管理" data-pretit="内存管理">内存管理</span>优化时，以下哪个描述最准确地概述了"Allocation Insight"功能在识别和解决内存问题中的作用</p> 
<p>​ A、Allocation Insight详细展示应用运行时的每条语句柄分配记录，便于开发者逐一检查内存使用，但不提供<span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;内存泄漏\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;内存泄漏\&quot;}&quot;}" data-tit="内存泄漏" data-pretit="内存泄漏">内存泄漏</span>的自动识别功能</p> 
<p>​ B、Allocation Insight仅提供内存分配总量的概览，帮助开发者宏观了解内存使用趋势，但对于具体泄漏或抖动问题无能为力</p> 
<p>​ <code style="user-select: auto;">C、Allocation Insight通过分析应用服务运行时的内存分配及使用情况，辅助定位内存泄漏、内存抖动和溢出问题，支持优化内存使用</code></p> 
<p>​ D、Allocation Insight主要关注于内存碎片整理，减少内存分配的不连续性问题，对内存泄漏和溢出问题的检测不是其主要功能</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-insight-session-allocations-memory-0000001481465958-V5" rel="nofollow" target="_blank">内存分析及优化-基础内存分析：Allocation分析-性能分析-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p><strong>18、项目需要同时进行应用和元服务的开发，并针对当前项目工程中的代码可以分别构建出应用和元服务的包，如何在DevEco Studio中设置不同的构建配置，达成这个目的 （不确定，把所有选项列出）</strong></p> 
<p>​ <code style="user-select: auto;">A、 在工程级别build-profile.json5定义两个product，将两个product的bundleType分别设置成app和atomicService</code></p> 
<p>​ <strong>B、修改工程级别的AppScope/app.json5中的bundleType值为atomicService</strong></p> 
<p>​ <strong>C、在模块级别build-profile.json5定义两个target，将两个target的bundleType分别设置成app和atomicService</strong></p> 
<p>​ <strong>D、修改工程级别的AppScope/app.json5中的bundleType值为app</strong></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/atomic-guides-V5/atomic-service-V5" rel="nofollow" target="_blank">元服务概述-指南 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>19、HarmonyOS应用开发团队正着手优化一款面向全球市场的在线教育应用，该应用在特定课程直播环节出现了性能波动和响应延迟的问题，严重影响用户体验。打算利用DevEco Profiler来进行性能优化。DevEco Profiler其设计核心和主要优势是什么</p> 
<p>​ A、DevEco Profiler采用Bottom-Up设计原则，从底层代码细节开始逐步构建性能模型</p> 
<p>​ B、DevEco Profiler专注于用户界面设计的美化，使开发者操作更为直观</p> 
<p>​ <code style="user-select: auto;">C、DevEco Profiler依据Top-Down设计理念，通过高度整合的数据展示范式，提供从宏观到微观的性能数据分析，加速开发者定位和解决问题的过程</code></p> 
<p>​ D、DevEco Profiler主要是一个自动化修复工具，能自动检测并解决所有HarmonyOS应用的性能问题</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-profiler-0000001818152621-V5" rel="nofollow" target="_blank">Profiler工具简介-性能分析-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>20、使用DevEco Studio进行复杂的跨设备功能开发与调试工作，期间频繁依赖本地模拟器来模拟多样化的设备环境。在这样的背景下，以下关于DevEco Studio本地模拟器所支持的规格与功能，哪一项描述是准确的</p> 
<p>​ A、本地模拟器当前不支持单元测试框架和UI测试框架的运行</p> 
<p>​ B、本地模拟器和真机的能力没有任何差异，真机上可以支持的能力在模拟器上都可以</p> 
<p>​ <code style="user-select: auto;">C、本地模拟器上运行的应用无需进行签名，简化了调试过程。</code></p> 
<p>​ D、本地模拟器当前不支持查看HiLog以及FaultLog</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-emulator-specification-0000001839876358-V5" rel="nofollow" target="_blank">模拟器与真机的差异-概述-使用模拟器运行应用/服务-应用/服务运行-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr>
                